package com.woniu.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.domain.User;
import com.woniu.vo.UserVo;
import org.apache.ibatis.annotations.Select;

public interface UserVoMapper extends BaseMapper<UserVo> {

    @Select("select \n" +
            "u.id, " +
            "u.username, " +
            "u.password, " +
            "u.tel, " +
            "u.salt,  " +
            "r.rolename \n" +
            "from t_user u\n" +
            "join t_user_role ur\n" +
            "on u.id=ur.uid\n" +
            "join t_role r\n" +
            "on ur.rid=r.role_id\n" +
            "${ew.customSqlSegment}")
    public IPage<UserVo> getUser(Page<UserVo> page, QueryWrapper<UserVo> ew);
}
